Mechanically Verifying the Correctness of an Offline Partial Evaluator
نویسنده
چکیده
We show that using deductive systems to specify an offline partial evaluator allows one to specify, prototype, and mechanically verify correctness via meta-programming — all within a single framework. For a λ-mix-style partial evaluator, we specify binding-time constraints using a natural-deduction logic, and the associated program specializer using natural (aka “deductive”) semantics. These deductive systems can be directly encoded in the Elf programming language — a logic programming language based on the LF logical framework. The specifications are then executable as logic programs. This provides a prototype implementation of the partial evaluator. Moreover, since deductive system proofs are accessible as objects in Elf, many aspects of the partial evaluator correctness proofs (e.g., the correctness of binding-time analysis) can be coded in Elf and mechanically checked.
منابع مشابه
Partial Evaluation with Partially Static Operations
Partial evaluation distinguishes between different binding times when manipulating values in a program. A partial evaluator performs evaluation steps on values with a static binding time whereas it generates code for values with a dynamic binding time. Binding time descriptions have evolved from monolithic to fine grained, partially static data structures where different components may have dif...
متن کاملPartial Evaluation of Call - by - value - calculus with Side - e ects
We present a framework of an online partial evaluator for a call-by-value -calculus with destructive updates of data structures. To our knowledge, this is the rst partial evaluator that can deal with full side-e ects as well as pointer equality in higher-order languages. Our partial evaluator uses a side-e ect analysis for handling assignment operations and then performs an online specializatio...
متن کاملPartial Evaluation of Call-by-value -calculus with Side-effects
We present a framework of an online partial evaluator for a callby-value -calculus with destructive updates of data structures. It properly and correctly specializes expressions that contain sideeffects, while preserving pointer equality, which is an important property for programs using updates. Our partial evaluator uses a side-effect analysis to extract immutable data structures and then per...
متن کاملMechanically Verifying Correctness of CPS Compilation
In this paper, we study the formalization of one-pass call-by-value CPS compilation using higher-order abstract syntax. In particular, we verify mechanically that the source program and the CPS-transformed program have the same observable behavior. A key advantage of this approach is that it avoids any administrative redexes thereby simplifying the proofs about CPS-translations. The CPS transla...
متن کاملOnline Type-Directed Partial Evaluation for Dynamically-Typed Languages∗
This article presents an alternative method of type-directed partial evaluation, which is simpler and more efficient than previous methods. Unlike previous methods, it is straightforwardly applicable to functional languages with various powerful type systems. As an extreme instance, this article mainly deals with a dynamically-typed functional language like Scheme. The key idea is to extend pri...
متن کامل